#include"thread.hpp"
#include<vector>
#include<unistd.h>

int main()
{
    std::vector<kzz::Thread>  threads;
    for(int i=0;i<10;i++)
    threads.emplace_back([]()
    {
        int cnt=1;
        while(cnt--)
        {
            char name[1024];
            pthread_getname_np(pthread_self(),name,sizeof(name));
            printf("my name is %s,add to  threads success\n",name);
        }
    }
    );
    for(int i=0;i<10;i++)
    {
        threads[i].Start();
        sleep(10);
    }
     for(int i=0;i<10;i++)
    {
        threads[i].Join();
        sleep(10);
    }
    
    return 0;
}